<?xml version="1.0" encoding="utf-8"?>
<taskrunner name="moveto.vidasave" version="1.0.2" date="2009-06-03" maxthreads="1">

  <!-- 
    log
      2009-06-03/MMA  Added task copy.desktop.shortcut
      2009-11-08/MMA  Removed all tasks related to desktop.shortcuts. No need to do this anylonger.
  -->
  
  <includes>
    <file name="vida.install.settings.xml" />
  </includes>

  <tasks>
    
    
    <task name="check.vidasave.dir" typename="@DirectoryExists">
      <parameters>
        <parameter name="directory" value="${target.vidasave.dir}"/>
        <parameter name="output.value" value="vidasave.dir.exists"/>
      </parameters>
    </task>

    <task name="change.attributes.on.vidasave" condition="¤{vidasave.dir.exists}=true" typename="@CommandLine">
      <description>
        removes the attribute read-only on all files in the dvdinput directory.
      </description>
      <dependencies list="check.vidasave.dir"/>
      <parameters>
        <parameter name="arguments" value="attrib -r /s"/>
        <parameter name="workingdirectory" value="${target.vidasave.dir}"/>
        <parameter name="useCmdExe" value="true"/>
      </parameters>
    </task>

    <foreach enum="config.files">
      <task name="configfile" typename="@FileCopy" allowMultipleInstances="true">
        <description>
          Copies config files from "target" to vidasave directory.
        </description>
        <dependencies list="change.attributes.on.vidasave"/>
        <parameters>
          
          <parameter name="src" value="$[config.files:target.dir]\$[config.files:key]"/>
          <parameter name="dst" value="${target.vidasave.dir}\$[config.files:key]"/>
          <parameter name="throwException" value="false"/>
          
        </parameters>
      </task>
    </foreach>


    <task name="check.accessserver.files" typename="@FileExist">
      <description>
        kontrollerar om gamla databaser finns i vidasave katalogen
      </description>
      <dependencies list="change.attributes.on.vidasave"/>
      <parameters>
        <parameter name="dir" value="${target.db.dir}"/>
        <parameter name="files" value="${db.accessserver.data.filename},${db.accessserver.log.filename}"/>
        <parameter name="output.value" value="accessserver.files.exists"/>
      </parameters>
    </task>


    <task name="copy.accessserver.mdf.to.vida.save" condition="¤{accessserver.files.exists}=true" typename="@FileCopy">
      <dependencies list="check.accessserver.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.accessserver.data.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.accessserver.data.filename}"/>
      </parameters>
    </task>

    <task name="copy.accessserver.ldf.to.vida.save" condition="¤{accessserver.files.exists}=true" typename="@FileCopy">
      <dependencies list="check.accessserver.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.accessserver.log.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.accessserver.log.filename}"/>
      </parameters>
    </task>



    <task name="check.diagswdlsession.files" typename="@FileExist">
      <description>
        kontrollerar om gamla databaser finns i vidasave katalogen
      </description>
      <dependencies list="change.attributes.on.vidasave"/>
      <parameters>
        <parameter name="dir" value="${target.db.dir}"/>
        <parameter name="files" value="${db.diagswdlsession.data.filename},${db.diagswdlsession.log.filename}"/>
        <parameter name="output.value" value="diagswdlsession.files.exists"/>
      </parameters>
    </task>

    <task name="copy.diagswdlsession.mdf.to.vida.save" condition="¤{diagswdlsession.files.exists}=true" typename="@FileCopy">
      <dependencies list="check.diagswdlsession.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.diagswdlsession.data.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.diagswdlsession.data.filename}"/>
      </parameters>
    </task>

    <task name="copy.diagswdlsession.ldf.to.vida.save" condition="¤{diagswdlsession.files.exists}=true" typename="@FileCopy">
      <dependencies list="check.diagswdlsession.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.diagswdlsession.log.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.diagswdlsession.log.filename}"/>
      </parameters>
    </task>



   

  </tasks>

</taskrunner>